package com.ty.utils;

import lombok.extern.slf4j.Slf4j;

/**
 * @Author Tommy
 * @Date 2023/10/22
 */
@Slf4j
public class ThreadUtil {

    public static void sleep(int seconds) {
        sleep(seconds, null);
    }

    public static void sleep(int seconds, String name) {
        try {
            log.info("{} 进程休眠 {} 秒", name, seconds);
            Thread.sleep(seconds * 1000);
        } catch (Exception e) {
            log.error(e.getMessage(), e);
        }
    }
}
